package com.cl.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

/**
 * Created by Chengxj on 2015/6/24.
 */
@Service
public class SyncService {

    protected Logger log = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private SinosoftUM sinosoftUM;

    /**
     * 同步用户和部门信息
     */
    @Scheduled(cron = "${schedule.userAndOrg}")
    public void SyncUserAndOrg() {
        log.info("开始同步用户和部门信息...");
        sinosoftUM.SyncUserOrgDataToDB();
        log.info("完成同步用户和部门信息。");
    }

}
